#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	char a[20] = { 0 };
	int i = 0;
	for (i = 0; i < 20; i++)
	{
		scanf("%c", &a[i]);
		if (a[i] == '0')
		{
			break;
		}
	}
	int countA = 0;
	int countB = 0;
	i = 0;
	while (a[i] != '0')
	{
		if (a[i] == 'A')
		{
			countA++;
		}
		if (a[i] == 'B')
		{
			countB++;
		}
		i++;
	}
	if (countA > countB)
	{
		printf("A");
	}
	else if(countB>countA)
	{
		printf("B");
	}
	
	else
		printf("E");
	return 0;
}
